package com.wangy.sct.common.core;

/**
 * ClassName: SctRuntimeException <br/>
 * Description:  <br/>
 *
 * @author wangyue
 * @version V1.0.0
 * @date 2018/11/8 3:40 PM
 */
public class SctRuntimeException extends RuntimeException implements SctExceptionDescription {

	private String errCode;

	public SctRuntimeException(Exception e) {
		super(e);
		this.errCode = SctEnum.UNKNOWEN_EXCEPTION.getErrCode();
	}

	public SctRuntimeException(SctEnum sctEnum) {
		super(sctEnum.getMessage());
		this.errCode = sctEnum.getErrCode();
	}

	public SctRuntimeException(SctEnum sctEnum, Throwable throwable) {
		super(sctEnum.getMessage(), throwable);
		this.errCode = sctEnum.getErrCode();
	}

	public SctRuntimeException(String errCode, String message) {
		super(message);
		this.errCode = errCode;
	}

	public SctRuntimeException(String errCode, String message, Throwable throwable) {
		super(message, throwable);
		this.errCode = errCode;
	}

	@Override
	public String getErrCode() {
		return this.errCode;
	}

}
